/*
 * Created by: 	Zhaoningbo
 * at:			2011-8-16 - 下午04:19:35
 * blog:		(http://zhaoningbo.iteye.com/)
 */
package com.gc.action;

import java.io.Serializable;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class LogAround implements MethodInterceptor, Serializable {

    private static final long serialVersionUID = 7086350960364171701L;

    private Log log = LogFactory.getLog(this.getClass().getName());

    public Object invoke(MethodInvocation methodInvocation) throws Throwable {

        log.info(methodInvocation.getArguments()[0] + " start");
        Object result = methodInvocation.proceed();
        log.info(methodInvocation.getArguments()[0] + " complete");

        return result;
    }

}
